const Mock = require('mockjs')
const Random = Mock.Random;
const StudentData = function () {
  let studentList = []
  for (let i = 0; i < 30; i++) {
    let studentObj = {
      key: i + 1 + '',
      name: Random.cname(),
      id: Random.integer(18240501, 16240901)+'',
      className: Random.integer(160401, 160420)+'',
      sex: (function () {
        if (Random.integer(0, 1) === 0) {
          return '男'
        } else {
          return '女'
        }
      })(),

    }
    studentList.push(studentObj)
  }
  return studentList
}
Mock.mock('/mock/student', StudentData)